/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-04-12
 * Time: 20:06
 */
public class Test3 {
    public static void drawShapes() {
        Rectangle rectangle = new Rectangle();
        Cycle cycle = new Cycle();
        Fish fish = new Fish();
        String[] shapes = {"cycle","rectangle","fish"};

        for(String x : shapes) {
            if(x.equals("cycle")) {
                cycle.draw();
            }else if(x.equals("rectangle")) {
                rectangle.draw();
            }else if(x.equals("fish")) {
                fish.draw();
            }
        }
    }

    public static void drawShapes1() {
        Shape[] shapes = {new Cycle(),new Rectangle(),new Fish()};
        for(Shape x: shapes) {
            x.draw();
        }
    }

    public static void main(String[] args) {
        drawShapes1();
    }


}
